import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;


public class P33 {
	private static List<Integer> primeList(int n) {
		List<Integer> list = new ArrayList<Integer>();
		
		for (int i = 2; i <= n; i++) {
			if (isPrime(i)) {
				list.add(i);
			}
		}
		
		return list;
	}
	
	private static boolean isPrime(int n) {
		int max = (int) Math.sqrt(n);
		for (int i = 2; i <= max; i++) {
			if (n % i == 0) {
				return false;
			}
		}
		
		return true;
	}
	
	private static int get(Map<Integer, Integer> primeFactor) {
		if (primeFactor.size() == 0) {
			return 1;
		}
		
		Iterator<Integer> iterator = primeFactor.keySet().iterator();
		int n = 1;
		
		while (iterator.hasNext()) {
			int prime = iterator.next();
			n *= Math.pow(prime, primeFactor.get(prime));
		}
		
		return n;
	}
	
	private static Map<Integer, Integer> primeFactor(int n) {
		List<Integer> primeList = primeList(n);
		Map<Integer, Integer> primeFactor = new HashMap<Integer, Integer>();
		for (Integer prime : primeList) {
			while (n%prime == 0) {
				Integer count = primeFactor.get(prime);
				if (count == null) {
					count = 1;
				} else {
					count += 1;
				}
				primeFactor.put(prime, count);
				n /= prime;
			}
		}
		return primeFactor;
	}
	
	private static int[] lowestCommonTerm(int numerator, int denominator) {
		Map<Integer, Integer> numeratorPrimeFactor = primeFactor(numerator);
		Map<Integer, Integer> denominatorPrimeFactor = primeFactor(denominator);
		
//		System.out.println(numeratorPrimeFactor);
//		System.out.println(denominatorPrimeFactor);
		
		Integer[] primes = numeratorPrimeFactor.keySet().toArray(new Integer[0]);
		for (int i = 0; i < primes.length; i++) {
			Integer prime = primes[i];
			
			if (denominatorPrimeFactor.containsKey(prime)) {
				int a = numeratorPrimeFactor.get(prime);
				int b = denominatorPrimeFactor.get(prime);
				int min = Math.min(a, b);
				
				a -= min;
				b -= min;
				
				if (a == 0) {
					numeratorPrimeFactor.remove(prime);
				} else {
					numeratorPrimeFactor.put(prime, a);
				}
				
				if (b == 0) {
					denominatorPrimeFactor.remove(prime);
				} else {
					denominatorPrimeFactor.put(prime, b);
				}
			}
		}
		
//		System.out.println(numeratorPrimeFactor);
//		System.out.println(denominatorPrimeFactor);
		
		return new int[] {get(numeratorPrimeFactor), get(denominatorPrimeFactor)};
		
	}

	public static int[] simplify(int numerator, int denominator) {
		String numeratorNum = String.valueOf(numerator);
		String denominatorNum = String.valueOf(denominator);

		for (int i = 0; i < numeratorNum.length(); i++) {
			String num = numeratorNum.substring(i, i + 1);
			
			if (denominatorNum.contains(num)) {
				int x = Integer.parseInt(numeratorNum.replaceFirst(num, ""));
				int y = Integer.parseInt(denominatorNum.replaceFirst(num, ""));
				
				if (x != 0 && y != 0) {
					//System.out.println(x + ":" + y);
					return lowestCommonTerm(x, y);					
				}
			}
		}
		
		return null;
	}

	public static void main(String[] args) {
//		System.out.println(primeList(100));
//		System.out.println(primeFactor(100));
//		System.out.println(Arrays.toString(lowestCommonTerm(2, 100)));
		
//		System.out.println(Arrays.toString(lowestCommonTerm(49, 98)));
//		System.out.println(Arrays.toString(simplify(49, 98)));
//		for (int denominator = 10; denominator <= 99; denominator++) {
//			System.out.println(denominator + ":" + primeFactor(denominator));
//		}
//		
		int numeratorProduction = 1;
		int denominatorProduction = 1;
		
		for (int denominator = 10; denominator <= 99; denominator++) {
			for (int numerator = 10; numerator < denominator; numerator++) {
//				System.out.println(numerator + "/" + denominator);
				
				
				if (denominator%10 == 0 && numerator%10 == 0) {
					
				} else {		
					//System.out.println(numerator + "/" + denominator);
					int[] value = simplify(numerator, denominator);
					//System.out.println(Arrays.toString(value));
					if (value != null) {
					
						int[] x = lowestCommonTerm(value[0], value[1]);
						int[] y = lowestCommonTerm(numerator, denominator);
						if (Arrays.equals(lowestCommonTerm(value[0], value[1]), lowestCommonTerm(numerator, denominator))) {
							System.out.println(">>>" + numerator + "/" + denominator);							
							numeratorProduction *= y[0];
							denominatorProduction *= y[1];
						}
					}
				}
			}
		}
		
		System.out.println(numeratorProduction);
		System.out.println(denominatorProduction);
		
		System.out.println(Arrays.toString(lowestCommonTerm(numeratorProduction, denominatorProduction)));
	}
}
